3.1.78 \(\int \frac {(a+b \tan (e+f x))^2 (A+B \tan (e+f x)+C \tan ^2(e+f x))}{(c+d \tan (e+f x))^2} \, dx\) [78]
Optimal. Leaf size=417 \[ -\frac {\left (a^2 \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^2 \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )-2 a b \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right ) x}{\left (c^2+d^2\right )^2}+\frac {\left (2 a b \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )-b^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right )^2 f}-\frac {(b c-a d) \left (b \left (2 c^4 C-B c^3 d+4 c^2 C d^2-3 B c d^3+2 A d^4\right )+a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right ) \log (c+d \tan (e+f x))}{d^3 \left (c^2+d^2\right )^2 f}+\frac {b^2 \left (2 c^2 C-B c d+(A+C) d^2\right ) \tan (e+f x)}{d^2 \left (c^2+d^2\right ) f}-\frac {\left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{d \left (c^2+d^2\right ) f (c+d \tan (e+f x))} \]
[Out]
-(a^2*(c^2*C-2*B*c*d-C*d^2-A*(c^2-d^2))-b^2*(c^2*C-2*B*c*d-C*d^2-A*(c^2-d^2))-2*a*b*(2*c*(A-C)*d-B*(c^2-d^2)))
*x/(c^2+d^2)^2+(2*a*b*(c^2*C-2*B*c*d-C*d^2-A*(c^2-d^2))+a^2*(2*c*(A-C)*d-B*(c^2-d^2))-b^2*(2*c*(A-C)*d-B*(c^2-
d^2)))*ln(cos(f*x+e))/(c^2+d^2)^2/f-(-a*d+b*c)*(b*(2*A*d^4-B*c^3*d-3*B*c*d^3+2*C*c^4+4*C*c^2*d^2)+a*d^2*(2*c*(
A-C)*d-B*(c^2-d^2)))*ln(c+d*tan(f*x+e))/d^3/(c^2+d^2)^2/f+b^2*(2*c^2*C-B*c*d+(A+C)*d^2)*tan(f*x+e)/d^2/(c^2+d^
2)/f-(A*d^2-B*c*d+C*c^2)*(a+b*tan(f*x+e))^2/d/(c^2+d^2)/f/(c+d*tan(f*x+e))
________________________________________________________________________________________
Rubi [A]
time = 0.73, antiderivative size = 417, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 45, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.133, Rules used = {3726, 3718,
3707, 3698, 31, 3556} \begin {gather*} \frac {\log (\cos (e+f x)) \left (a^2 \left (2 c d (A-C)-B \left (c^2-d^2\right )\right )+2 a b \left (-A \left (c^2-d^2\right )-2 B c d+c^2 C-C d^2\right )-b^2 \left (2 c d (A-C)-B \left (c^2-d^2\right )\right )\right )}{f \left (c^2+d^2\right )^2}-\frac {x \left (a^2 \left (-A \left (c^2-d^2\right )-2 B c d+c^2 C-C d^2\right )-2 a b \left (2 c d (A-C)-B \left (c^2-d^2\right )\right )-b^2 \left (-A \left (c^2-d^2\right )-2 B c d+c^2 C-C d^2\right )\right )}{\left (c^2+d^2\right )^2}-\frac {\left (A d^2-B c d+c^2 C\right ) (a+b \tan (e+f x))^2}{d f \left (c^2+d^2\right ) (c+d \tan (e+f x))}-\frac {(b c-a d) \left (a d^2 \left (2 c d (A-C)-B \left (c^2-d^2\right )\right )+b \left (2 A d^4-B c^3 d-3 B c d^3+2 c^4 C+4 c^2 C d^2\right )\right ) \log (c+d \tan (e+f x))}{d^3 f \left (c^2+d^2\right )^2}+\frac {b^2 \tan (e+f x) \left (d^2 (A+C)-B c d+2 c^2 C\right )}{d^2 f \left (c^2+d^2\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
Int[((a + b*Tan[e + f*x])^2*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2))/(c + d*Tan[e + f*x])^2,x]
[Out]
-(((a^2*(c^2*C - 2*B*c*d - C*d^2 - A*(c^2 - d^2)) - b^2*(c^2*C - 2*B*c*d - C*d^2 - A*(c^2 - d^2)) - 2*a*b*(2*c
*(A - C)*d - B*(c^2 - d^2)))*x)/(c^2 + d^2)^2) + ((2*a*b*(c^2*C - 2*B*c*d - C*d^2 - A*(c^2 - d^2)) + a^2*(2*c*
(A - C)*d - B*(c^2 - d^2)) - b^2*(2*c*(A - C)*d - B*(c^2 - d^2)))*Log[Cos[e + f*x]])/((c^2 + d^2)^2*f) - ((b*c
- a*d)*(b*(2*c^4*C - B*c^3*d + 4*c^2*C*d^2 - 3*B*c*d^3 + 2*A*d^4) + a*d^2*(2*c*(A - C)*d - B*(c^2 - d^2)))*Lo
g[c + d*Tan[e + f*x]])/(d^3*(c^2 + d^2)^2*f) + (b^2*(2*c^2*C - B*c*d + (A + C)*d^2)*Tan[e + f*x])/(d^2*(c^2 +
d^2)*f) - ((c^2*C - B*c*d + A*d^2)*(a + b*Tan[e + f*x])^2)/(d*(c^2 + d^2)*f*(c + d*Tan[e + f*x]))
Rule 31
Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]
Rule 3556
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]
Rule 3698
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Dist[
A/(b*f), Subst[Int[(a + x)^m, x], x, b*Tan[e + f*x]], x] /; FreeQ[{a, b, e, f, A, C, m}, x] && EqQ[A, C]
Rule 3707
Int[((A_) + (B_.)*tan[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2)/((a_.) + (b_.)*tan[(e_.) + (f_.)*
(x_)]), x_Symbol] :> Simp[(a*A + b*B - a*C)*(x/(a^2 + b^2)), x] + (Dist[(A*b^2 - a*b*B + a^2*C)/(a^2 + b^2), I
nt[(1 + Tan[e + f*x]^2)/(a + b*Tan[e + f*x]), x], x] - Dist[(A*b - a*B - b*C)/(a^2 + b^2), Int[Tan[e + f*x], x
], x]) /; FreeQ[{a, b, e, f, A, B, C}, x] && NeQ[A*b^2 - a*b*B + a^2*C, 0] && NeQ[a^2 + b^2, 0] && NeQ[A*b - a
*B - b*C, 0]
Rule 3718
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*tan[(e
_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[b*C*Tan[e + f*x]*((c + d*Tan[e + f*x])
^(n + 1)/(d*f*(n + 2))), x] - Dist[1/(d*(n + 2)), Int[(c + d*Tan[e + f*x])^n*Simp[b*c*C - a*A*d*(n + 2) - (A*b
+ a*B - b*C)*d*(n + 2)*Tan[e + f*x] - (a*C*d*(n + 2) - b*(c*C - B*d*(n + 2)))*Tan[e + f*x]^2, x], x], x] /; F
reeQ[{a, b, c, d, e, f, A, B, C, n}, x] && NeQ[b*c - a*d, 0] && NeQ[c^2 + d^2, 0] && !LtQ[n, -1]
Rule 3726
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (B_.)*t
an[(e_.) + (f_.)*(x_)] + (C_.)*tan[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(A*d^2 + c*(c*C - B*d))*(a + b*Ta
n[e + f*x])^m*((c + d*Tan[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 + d^2))), x] - Dist[1/(d*(n + 1)*(c^2 + d^2)), I
nt[(a + b*Tan[e + f*x])^(m - 1)*(c + d*Tan[e + f*x])^(n + 1)*Simp[A*d*(b*d*m - a*c*(n + 1)) + (c*C - B*d)*(b*c
*m + a*d*(n + 1)) - d*(n + 1)*((A - C)*(b*c - a*d) + B*(a*c + b*d))*Tan[e + f*x] - b*(d*(B*c - A*d)*(m + n + 1
) - C*(c^2*m - d^2*(n + 1)))*Tan[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c -
a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[c^2 + d^2, 0] && GtQ[m, 0] && LtQ[n, -1]
Rubi steps
\begin {align*} \int \frac {(a+b \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^2} \, dx &=-\frac {\left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{d \left (c^2+d^2\right ) f (c+d \tan (e+f x))}+\frac {\int \frac {(a+b \tan (e+f x)) \left (A d (a c+2 b d)+(2 b c-a d) (c C-B d)+d ((A-C) (b c-a d)+B (a c+b d)) \tan (e+f x)+b \left (2 c^2 C-B c d+(A+C) d^2\right ) \tan ^2(e+f x)\right )}{c+d \tan (e+f x)} \, dx}{d \left (c^2+d^2\right )}\\ &=\frac {b^2 \left (2 c^2 C-B c d+(A+C) d^2\right ) \tan (e+f x)}{d^2 \left (c^2+d^2\right ) f}-\frac {\left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{d \left (c^2+d^2\right ) f (c+d \tan (e+f x))}-\frac {\int \frac {b^2 c \left (2 c^2 C-B c d+(A+C) d^2\right )-a d (A d (a c+2 b d)+(2 b c-a d) (c C-B d))-d^2 \left (2 a b (A c-c C+B d)+a^2 (B c-(A-C) d)-b^2 (B c-(A-C) d)\right ) \tan (e+f x)+b (2 b c C-b B d-2 a C d) \left (c^2+d^2\right ) \tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx}{d^2 \left (c^2+d^2\right )}\\ &=-\frac {\left (a^2 \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^2 \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )-2 a b \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right ) x}{\left (c^2+d^2\right )^2}+\frac {b^2 \left (2 c^2 C-B c d+(A+C) d^2\right ) \tan (e+f x)}{d^2 \left (c^2+d^2\right ) f}-\frac {\left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{d \left (c^2+d^2\right ) f (c+d \tan (e+f x))}-\frac {\left (2 a b \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )-b^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right ) \int \tan (e+f x) \, dx}{\left (c^2+d^2\right )^2}-\frac {\left ((b c-a d) \left (b \left (2 c^4 C-B c^3 d+4 c^2 C d^2-3 B c d^3+2 A d^4\right )+a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )\right ) \int \frac {1+\tan ^2(e+f x)}{c+d \tan (e+f x)} \, dx}{d^2 \left (c^2+d^2\right )^2}\\ &=-\frac {\left (a^2 \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^2 \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )-2 a b \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right ) x}{\left (c^2+d^2\right )^2}+\frac {\left (2 a b \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )-b^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right )^2 f}+\frac {b^2 \left (2 c^2 C-B c d+(A+C) d^2\right ) \tan (e+f x)}{d^2 \left (c^2+d^2\right ) f}-\frac {\left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{d \left (c^2+d^2\right ) f (c+d \tan (e+f x))}-\frac {\left ((b c-a d) \left (b \left (2 c^4 C-B c^3 d+4 c^2 C d^2-3 B c d^3+2 A d^4\right )+a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )\right ) \text {Subst}\left (\int \frac {1}{c+x} \, dx,x,d \tan (e+f x)\right )}{d^3 \left (c^2+d^2\right )^2 f}\\ &=-\frac {\left (a^2 \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^2 \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )-2 a b \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right ) x}{\left (c^2+d^2\right )^2}+\frac {\left (2 a b \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )-b^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right ) \log (\cos (e+f x))}{\left (c^2+d^2\right )^2 f}-\frac {(b c-a d) \left (b \left (2 c^4 C-B c^3 d+4 c^2 C d^2-3 B c d^3+2 A d^4\right )+a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right ) \log (c+d \tan (e+f x))}{d^3 \left (c^2+d^2\right )^2 f}+\frac {b^2 \left (2 c^2 C-B c d+(A+C) d^2\right ) \tan (e+f x)}{d^2 \left (c^2+d^2\right ) f}-\frac {\left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{d \left (c^2+d^2\right ) f (c+d \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 7.35, size = 2636, normalized size = 6.32 \begin {gather*} \text {Result too large to show} \end {gather*}
Antiderivative was successfully verified.
[In]
Integrate[((a + b*Tan[e + f*x])^2*(A + B*Tan[e + f*x] + C*Tan[e + f*x]^2))/(c + d*Tan[e + f*x])^2,x]
[Out]
(((-2*I)*b^2*c^10*C*d^2 + I*b^2*B*c^9*d^3 + (2*I)*a*b*c^9*C*d^3 - 2*b^2*c^9*C*d^3 + b^2*B*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*a*b*B*c*d^4 - 2*a^2*c*C*d^4 + 2*a*A*b*d^5 + a
^2*B*d^5)*ArcTan[Tan[e + f*x]]*(c*Cos[e + f*x] + d*Sin[e + f*x])^2*(a + b*Tan[e + f*x])^2)/(d^3*(c^2 + d^2)^2*
f*(a*Cos[e + f*x] + b*Sin[e + f*x])^2*(c + d*Tan[e + f*x])^2) + ((2*b^2*c*C - b^2*B*d - 2*a*b*C*d)*Log[Cos[e +
f*x]]*(c*Cos[e + f*x] + d*Sin[e + f*x])^2*(a + b*Tan[e + f*x])^2)/(d^3*f*(a*Cos[e + f*x] + b*Sin[e + f*x])^2*
(c + d*Tan[e + f*x])^2) + ((-2*b^2*c^5*C + b^2*B*c^4*d + 2*a*b*c^4*C*d - 4*b^2*c^3*C*d^2 - 2*a*A*b*c^2*d^3 - a
^2*B*c^2*d^3 + 3*b^2*B*c^2*d^3 + 6*a*b*c^2*C*d^3 + 2*a^2*A*c*d^4 - 2*A*b^2*c*d^4 - 4*a*b*B*c*d^4 - 2*a^2*c*C*d
^4 + 2*a*A*b*d^5 + a^2*B*d^5)*Log[(c*Cos[e + f*x] + d*Sin[e + f*x])^2]*(c*Cos[e + f*x] + d*Sin[e + f*x])^2*(a
+ b*Tan[e + f*x])^2)/(2*d^3*(c^2 + d^2)^2*f*(a*Cos[e + f*x] + b*Sin[e + f*x])^2*(c + d*Tan[e + f*x])^2) + (Sec
[e + f*x]*(c*Cos[e + f*x] + d*Sin[e + f*x])*(b^2*c^5*C*d + 2*b^2*c^3*C*d^3 + b^2*c*C*d^5 + a^2*A*c^4*d^2*(e +
f*x) - A*b^2*c^4*d^2*(e + f*x) - 2*a*b*B*c^4*d^2*(e + f*x) - a^2*c^4*C*d^2*(e + f*x) + b^2*c^4*C*d^2*(e + f*x)
+ 4*a*A*b*c^3*d^3*(e + f*x) + 2*a^2*B*c^3*d^3*(e + f*x) - 2*b^2*B*c^3*d^3*(e + f*x) - 4*a*b*c^3*C*d^3*(e + f*
x) - a^2*A*c^2*d^4*(e + f*x) + A*b^2*c^2*d^4*(e + f*x) + 2*a*b*B*c^2*d^4*(e + f*x) + a^2*c^2*C*d^4*(e + f*x) -
b^2*c^2*C*d^4*(e + f*x) - b^2*c^5*C*d*Cos[2*(e + f*x)] - 2*b^2*c^3*C*d^3*Cos[2*(e + f*x)] - b^2*c*C*d^5*Cos[2
*(e + f*x)] + a^2*A*c^4*d^2*(e + f*x)*Cos[2*(e + f*x)] - A*b^2*c^4*d^2*(e + f*x)*Cos[2*(e + f*x)] - 2*a*b*B*c^
4*d^2*(e + f*x)*Cos[2*(e + f*x)] - a^2*c^4*C*d^2*(e + f*x)*Cos[2*(e + f*x)] + b^2*c^4*C*d^2*(e + f*x)*Cos[2*(e
+ f*x)] + 4*a*A*b*c^3*d^3*(e + f*x)*Cos[2*(e + f*x)] + 2*a^2*B*c^3*d^3*(e + f*x)*Cos[2*(e + f*x)] - 2*b^2*B*c
^3*d^3*(e + f*x)*Cos[2*(e + f*x)] - 4*a*b*c^3*C*d^3*(e + f*x)*Cos[2*(e + f*x)] - a^2*A*c^2*d^4*(e + f*x)*Cos[2
*(e + f*x)] + A*b^2*c^2*d^4*(e + f*x)*Cos[2*(e + f*x)] + 2*a*b*B*c^2*d^4*(e + f*x)*Cos[2*(e + f*x)] + a^2*c^2*
C*d^4*(e + f*x)*Cos[2*(e + f*x)] - b^2*c^2*C*d^4*(e + f*x)*Cos[2*(e + f*x)] + 2*b^2*c^6*C*Sin[2*(e + f*x)] - b
^2*B*c^5*d*Sin[2*(e + f*x)] - 2*a*b*c^5*C*d*Sin[2*(e + f*x)] + A*b^2*c^4*d^2*Sin[2*(e + f*x)] + 2*a*b*B*c^4*d^
2*Sin[2*(e + f*x)] + a^2*c^4*C*d^2*Sin[2*(e + f*x)] + 3*b^2*c^4*C*d^2*Sin[2*(e + f*x)] - 2*a*A*b*c^3*d^3*Sin[2
*(e + f*x)] - a^2*B*c^3*d^3*Sin[2*(e + f*x)] - b^2*B*c^3*d^3*Sin[2*(e + f*x)] - 2*a*b*c^3*C*d^3*Sin[2*(e + f*x
)] + a^2*A*c^2*d^4*Sin[2*(e + f*x)] + A*b^2*c^2*d^4*Sin[2*(e + f*x)] + 2*a*b*B*c^2*d^4*Sin[2*(e + f*x)] + a^2*
c^2*C*d^4*Sin[2*(e + f*x)] + b^2*c^2*C*d^4*Sin[2*(e + f*x)] - 2*a*A*b*c*d^5*Sin[2*(e + f*x)] - a^2*B*c*d^5*Sin
[2*(e + f*x)] + a^2*A*d^6*Sin[2*(e + f*x)] + a^2*A*c^3*d^3*(e + f*x)*Sin[2*(e + f*x)] - A*b^2*c^3*d^3*(e + f*x
)*Sin[2*(e + f*x)] - 2*a*b*B*c^3*d^3*(e + f*x)*Sin[2*(e + f*x)] - a^2*c^3*C*d^3*(e + f*x)*Sin[2*(e + f*x)] + b
^2*c^3*C*d^3*(e + f*x)*Sin[2*(e + f*x)] + 4*a*A*b*c^2*d^4*(e + f*x)*Sin[2*(e + f*x)] + 2*a^2*B*c^2*d^4*(e + f*
x)*Sin[2*(e + f*x)] - 2*b^2*B*c^2*d^4*(e + f*x)*Sin[2*(e + f*x)] - 4*a*b*c^2*C*d^4*(e + f*x)*Sin[2*(e + f*x)]
- a^2*A*c*d^5*(e + f*x)*Sin[2*(e + f*x)] + A*b^2*c*d^5*(e + f*x)*Sin[2*(e + f*x)] + 2*a*b*B*c*d^5*(e + f*x)*Si
n[2*(e + f*x)] + a^2*c*C*d^5*(e + f*x)*Sin[2*(e + f*x)] - b^2*c*C*d^5*(e + f*x)*Sin[2*(e + f*x)])*(a + b*Tan[e
+ f*x])^2)/(2*c*(c - I*d)^2*(c + I*d)^2*d^2*f*(a*Cos[e + f*x] + b*Sin[e + f*x])^2*(c + d*Tan[e + f*x])^2)
________________________________________________________________________________________
Maple [A]
time = 0.35, size = 552, normalized size = 1.32
| | |
method |
result |
size |
| | |
derivativedivides |
\(\frac {\frac {b^{2} C \tan \left (f x +e \right )}{d^{2}}-\frac {A \,a^{2} d^{4}-2 A a b c \,d^{3}+A \,b^{2} c^{2} d^{2}-B \,a^{2} c \,d^{3}+2 B a b \,c^{2} d^{2}-B \,b^{2} c^{3} d +C \,a^{2} c^{2} d^{2}-2 C a b \,c^{3} d +C \,b^{2} c^{4}}{d^{3} \left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )}+\frac {\left (2 A \,a^{2} c \,d^{4}-2 A a b \,c^{2} d^{3}+2 A a b \,d^{5}-2 A \,b^{2} c \,d^{4}-B \,a^{2} c^{2} d^{3}+B \,a^{2} d^{5}-4 B a b c \,d^{4}+B \,b^{2} c^{4} d +3 B \,b^{2} c^{2} d^{3}-2 C \,a^{2} c \,d^{4}+2 C a b \,c^{4} d +6 C a b \,c^{2} d^{3}-2 C \,b^{2} c^{5}-4 C \,b^{2} c^{3} d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{d^{3} \left (c^{2}+d^{2}\right )^{2}}+\frac {\frac {\left (-2 A \,a^{2} c d +2 A a b \,c^{2}-2 A a b \,d^{2}+2 A \,b^{2} c d +B \,a^{2} c^{2}-B \,a^{2} d^{2}+4 B a b c d -B \,b^{2} c^{2}+B \,b^{2} d^{2}+2 C \,a^{2} c d -2 C a b \,c^{2}+2 C a b \,d^{2}-2 C \,b^{2} c d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (A \,a^{2} c^{2}-A \,a^{2} d^{2}+4 A a b c d -A \,b^{2} c^{2}+A \,b^{2} d^{2}+2 B \,a^{2} c d -2 B a b \,c^{2}+2 B a b \,d^{2}-2 B \,b^{2} c d -C \,a^{2} c^{2}+a^{2} C \,d^{2}-4 C a b c d +C \,b^{2} c^{2}-C \,b^{2} d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{2}}}{f}\) |
\(552\) |
default |
\(\frac {\frac {b^{2} C \tan \left (f x +e \right )}{d^{2}}-\frac {A \,a^{2} d^{4}-2 A a b c \,d^{3}+A \,b^{2} c^{2} d^{2}-B \,a^{2} c \,d^{3}+2 B a b \,c^{2} d^{2}-B \,b^{2} c^{3} d +C \,a^{2} c^{2} d^{2}-2 C a b \,c^{3} d +C \,b^{2} c^{4}}{d^{3} \left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )}+\frac {\left (2 A \,a^{2} c \,d^{4}-2 A a b \,c^{2} d^{3}+2 A a b \,d^{5}-2 A \,b^{2} c \,d^{4}-B \,a^{2} c^{2} d^{3}+B \,a^{2} d^{5}-4 B a b c \,d^{4}+B \,b^{2} c^{4} d +3 B \,b^{2} c^{2} d^{3}-2 C \,a^{2} c \,d^{4}+2 C a b \,c^{4} d +6 C a b \,c^{2} d^{3}-2 C \,b^{2} c^{5}-4 C \,b^{2} c^{3} d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{d^{3} \left (c^{2}+d^{2}\right )^{2}}+\frac {\frac {\left (-2 A \,a^{2} c d +2 A a b \,c^{2}-2 A a b \,d^{2}+2 A \,b^{2} c d +B \,a^{2} c^{2}-B \,a^{2} d^{2}+4 B a b c d -B \,b^{2} c^{2}+B \,b^{2} d^{2}+2 C \,a^{2} c d -2 C a b \,c^{2}+2 C a b \,d^{2}-2 C \,b^{2} c d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (A \,a^{2} c^{2}-A \,a^{2} d^{2}+4 A a b c d -A \,b^{2} c^{2}+A \,b^{2} d^{2}+2 B \,a^{2} c d -2 B a b \,c^{2}+2 B a b \,d^{2}-2 B \,b^{2} c d -C \,a^{2} c^{2}+a^{2} C \,d^{2}-4 C a b c d +C \,b^{2} c^{2}-C \,b^{2} d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{2}}}{f}\) |
\(552\) |
norman |
\(\frac {\frac {c \left (A \,a^{2} c^{2}-A \,a^{2} d^{2}+4 A a b c d -A \,b^{2} c^{2}+A \,b^{2} d^{2}+2 B \,a^{2} c d -2 B a b \,c^{2}+2 B a b \,d^{2}-2 B \,b^{2} c d -C \,a^{2} c^{2}+a^{2} C \,d^{2}-4 C a b c d +C \,b^{2} c^{2}-C \,b^{2} d^{2}\right ) x}{c^{4}+2 c^{2} d^{2}+d^{4}}+\frac {b^{2} C \left (\tan ^{2}\left (f x +e \right )\right )}{d f}+\frac {d \left (A \,a^{2} c^{2}-A \,a^{2} d^{2}+4 A a b c d -A \,b^{2} c^{2}+A \,b^{2} d^{2}+2 B \,a^{2} c d -2 B a b \,c^{2}+2 B a b \,d^{2}-2 B \,b^{2} c d -C \,a^{2} c^{2}+a^{2} C \,d^{2}-4 C a b c d +C \,b^{2} c^{2}-C \,b^{2} d^{2}\right ) x \tan \left (f x +e \right )}{c^{4}+2 c^{2} d^{2}+d^{4}}-\frac {A \,a^{2} d^{4}-2 A a b c \,d^{3}+A \,b^{2} c^{2} d^{2}-B \,a^{2} c \,d^{3}+2 B a b \,c^{2} d^{2}-B \,b^{2} c^{3} d +C \,a^{2} c^{2} d^{2}-2 C a b \,c^{3} d +2 C \,b^{2} c^{4}+C \,b^{2} c^{2} d^{2}}{f \,d^{3} \left (c^{2}+d^{2}\right )}}{c +d \tan \left (f x +e \right )}+\frac {\left (2 A \,a^{2} c \,d^{4}-2 A a b \,c^{2} d^{3}+2 A a b \,d^{5}-2 A \,b^{2} c \,d^{4}-B \,a^{2} c^{2} d^{3}+B \,a^{2} d^{5}-4 B a b c \,d^{4}+B \,b^{2} c^{4} d +3 B \,b^{2} c^{2} d^{3}-2 C \,a^{2} c \,d^{4}+2 C a b \,c^{4} d +6 C a b \,c^{2} d^{3}-2 C \,b^{2} c^{5}-4 C \,b^{2} c^{3} d^{2}\right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{4}+2 c^{2} d^{2}+d^{4}\right ) d^{3} f}-\frac {\left (2 A \,a^{2} c d -2 A a b \,c^{2}+2 A a b \,d^{2}-2 A \,b^{2} c d -B \,a^{2} c^{2}+B \,a^{2} d^{2}-4 B a b c d +B \,b^{2} c^{2}-B \,b^{2} d^{2}-2 C \,a^{2} c d +2 C a b \,c^{2}-2 C a b \,d^{2}+2 C \,b^{2} c d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (c^{4}+2 c^{2} d^{2}+d^{4}\right )}\) |
\(743\) |
risch |
\(\text {Expression too large to display}\) |
\(2406\) |
| | |
|
|
|
Verification of antiderivative is not currently implemented for this CAS.
[In]
int((a+b*tan(f*x+e))^2*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(c+d*tan(f*x+e))^2,x,method=_RETURNVERBOSE)
[Out]
1/f*(b^2*C/d^2*tan(f*x+e)-1/d^3*(A*a^2*d^4-2*A*a*b*c*d^3+A*b^2*c^2*d^2-B*a^2*c*d^3+2*B*a*b*c^2*d^2-B*b^2*c^3*d
+C*a^2*c^2*d^2-2*C*a*b*c^3*d+C*b^2*c^4)/(c^2+d^2)/(c+d*tan(f*x+e))+1/d^3*(2*A*a^2*c*d^4-2*A*a*b*c^2*d^3+2*A*a*
b*d^5-2*A*b^2*c*d^4-B*a^2*c^2*d^3+B*a^2*d^5-4*B*a*b*c*d^4+B*b^2*c^4*d+3*B*b^2*c^2*d^3-2*C*a^2*c*d^4+2*C*a*b*c^
4*d+6*C*a*b*c^2*d^3-2*C*b^2*c^5-4*C*b^2*c^3*d^2)/(c^2+d^2)^2*ln(c+d*tan(f*x+e))+1/(c^2+d^2)^2*(1/2*(-2*A*a^2*c
*d+2*A*a*b*c^2-2*A*a*b*d^2+2*A*b^2*c*d+B*a^2*c^2-B*a^2*d^2+4*B*a*b*c*d-B*b^2*c^2+B*b^2*d^2+2*C*a^2*c*d-2*C*a*b
*c^2+2*C*a*b*d^2-2*C*b^2*c*d)*ln(1+tan(f*x+e)^2)+(A*a^2*c^2-A*a^2*d^2+4*A*a*b*c*d-A*b^2*c^2+A*b^2*d^2+2*B*a^2*
c*d-2*B*a*b*c^2+2*B*a*b*d^2-2*B*b^2*c*d-C*a^2*c^2+C*a^2*d^2-4*C*a*b*c*d+C*b^2*c^2-C*b^2*d^2)*arctan(tan(f*x+e)
)))
________________________________________________________________________________________
Maxima [A]
time = 0.56, size = 498, normalized size = 1.19 \begin {gather*} \frac {\frac {2 \, C b^{2} \tan \left (f x + e\right )}{d^{2}} + \frac {2 \, {\left ({\left ({\left (A - C\right )} a^{2} - 2 \, B a b - {\left (A - C\right )} b^{2}\right )} c^{2} + 2 \, {\left (B a^{2} + 2 \, {\left (A - C\right )} a b - B b^{2}\right )} c d - {\left ({\left (A - C\right )} a^{2} - 2 \, B a b - {\left (A - C\right )} b^{2}\right )} d^{2}\right )} {\left (f x + e\right )}}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} - \frac {2 \, {\left (2 \, C b^{2} c^{5} + 4 \, C b^{2} c^{3} d^{2} - {\left (2 \, C a b + B b^{2}\right )} c^{4} d + {\left (B a^{2} + 2 \, {\left (A - 3 \, C\right )} a b - 3 \, B b^{2}\right )} c^{2} d^{3} - 2 \, {\left ({\left (A - C\right )} a^{2} - 2 \, B a b - A b^{2}\right )} c d^{4} - {\left (B a^{2} + 2 \, A a b\right )} d^{5}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{4} d^{3} + 2 \, c^{2} d^{5} + d^{7}} + \frac {{\left ({\left (B a^{2} + 2 \, {\left (A - C\right )} a b - B b^{2}\right )} c^{2} - 2 \, {\left ({\left (A - C\right )} a^{2} - 2 \, B a b - {\left (A - C\right )} b^{2}\right )} c d - {\left (B a^{2} + 2 \, {\left (A - C\right )} a b - B b^{2}\right )} d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} - \frac {2 \, {\left (C b^{2} c^{4} + A a^{2} d^{4} - {\left (2 \, C a b + B b^{2}\right )} c^{3} d + {\left (C a^{2} + 2 \, B a b + A b^{2}\right )} c^{2} d^{2} - {\left (B a^{2} + 2 \, A a b\right )} c d^{3}\right )}}{c^{3} d^{3} + c d^{5} + {\left (c^{2} d^{4} + d^{6}\right )} \tan \left (f x + e\right )}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+b*tan(f*x+e))^2*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(c+d*tan(f*x+e))^2,x, algorithm="maxima")
[Out]
1/2*(2*C*b^2*tan(f*x + e)/d^2 + 2*(((A - C)*a^2 - 2*B*a*b - (A - C)*b^2)*c^2 + 2*(B*a^2 + 2*(A - C)*a*b - B*b^
2)*c*d - ((A - C)*a^2 - 2*B*a*b - (A - C)*b^2)*d^2)*(f*x + e)/(c^4 + 2*c^2*d^2 + d^4) - 2*(2*C*b^2*c^5 + 4*C*b
^2*c^3*d^2 - (2*C*a*b + B*b^2)*c^4*d + (B*a^2 + 2*(A - 3*C)*a*b - 3*B*b^2)*c^2*d^3 - 2*((A - C)*a^2 - 2*B*a*b
- A*b^2)*c*d^4 - (B*a^2 + 2*A*a*b)*d^5)*log(d*tan(f*x + e) + c)/(c^4*d^3 + 2*c^2*d^5 + d^7) + ((B*a^2 + 2*(A -
C)*a*b - B*b^2)*c^2 - 2*((A - C)*a^2 - 2*B*a*b - (A - C)*b^2)*c*d - (B*a^2 + 2*(A - C)*a*b - B*b^2)*d^2)*log(
tan(f*x + e)^2 + 1)/(c^4 + 2*c^2*d^2 + d^4) - 2*(C*b^2*c^4 + A*a^2*d^4 - (2*C*a*b + B*b^2)*c^3*d + (C*a^2 + 2*
B*a*b + A*b^2)*c^2*d^2 - (B*a^2 + 2*A*a*b)*c*d^3)/(c^3*d^3 + c*d^5 + (c^2*d^4 + d^6)*tan(f*x + e)))/f
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 948 vs.
\(2 (422) = 844\).
time = 4.40, size = 948, normalized size = 2.27 \begin {gather*} -\frac {2 \, C b^{2} c^{4} d^{2} + 2 \, A a^{2} d^{6} - 2 \, {\left (2 \, C a b + B b^{2}\right )} c^{3} d^{3} + 2 \, {\left (C a^{2} + 2 \, B a b + A b^{2}\right )} c^{2} d^{4} - 2 \, {\left (B a^{2} + 2 \, A a b\right )} c d^{5} - 2 \, {\left ({\left ({\left (A - C\right )} a^{2} - 2 \, B a b - {\left (A - C\right )} b^{2}\right )} c^{3} d^{3} + 2 \, {\left (B a^{2} + 2 \, {\left (A - C\right )} a b - B b^{2}\right )} c^{2} d^{4} - {\left ({\left (A - C\right )} a^{2} - 2 \, B a b - {\left (A - C\right )} b^{2}\right )} c d^{5}\right )} f x - 2 \, {\left (C b^{2} c^{4} d^{2} + 2 \, C b^{2} c^{2} d^{4} + C b^{2} d^{6}\right )} \tan \left (f x + e\right )^{2} + {\left (2 \, C b^{2} c^{6} + 4 \, C b^{2} c^{4} d^{2} - {\left (2 \, C a b + B b^{2}\right )} c^{5} d + {\left (B a^{2} + 2 \, {\left (A - 3 \, C\right )} a b - 3 \, B b^{2}\right )} c^{3} d^{3} - 2 \, {\left ({\left (A - C\right )} a^{2} - 2 \, B a b - A b^{2}\right )} c^{2} d^{4} - {\left (B a^{2} + 2 \, A a b\right )} c d^{5} + {\left (2 \, C b^{2} c^{5} d + 4 \, C b^{2} c^{3} d^{3} - {\left (2 \, C a b + B b^{2}\right )} c^{4} d^{2} + {\left (B a^{2} + 2 \, {\left (A - 3 \, C\right )} a b - 3 \, B b^{2}\right )} c^{2} d^{4} - 2 \, {\left ({\left (A - C\right )} a^{2} - 2 \, B a b - A b^{2}\right )} c d^{5} - {\left (B a^{2} + 2 \, A a b\right )} d^{6}\right )} \tan \left (f x + e\right )\right )} \log \left (\frac {d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right ) - {\left (2 \, C b^{2} c^{6} + 4 \, C b^{2} c^{4} d^{2} + 2 \, C b^{2} c^{2} d^{4} - {\left (2 \, C a b + B b^{2}\right )} c^{5} d - 2 \, {\left (2 \, C a b + B b^{2}\right )} c^{3} d^{3} - {\left (2 \, C a b + B b^{2}\right )} c d^{5} + {\left (2 \, C b^{2} c^{5} d + 4 \, C b^{2} c^{3} d^{3} + 2 \, C b^{2} c d^{5} - {\left (2 \, C a b + B b^{2}\right )} c^{4} d^{2} - 2 \, {\left (2 \, C a b + B b^{2}\right )} c^{2} d^{4} - {\left (2 \, C a b + B b^{2}\right )} d^{6}\right )} \tan \left (f x + e\right )\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right ) - 2 \, {\left (2 \, C b^{2} c^{5} d - {\left (2 \, C a b + B b^{2}\right )} c^{4} d^{2} + {\left (C a^{2} + 2 \, B a b + {\left (A + 2 \, C\right )} b^{2}\right )} c^{3} d^{3} - {\left (B a^{2} + 2 \, A a b\right )} c^{2} d^{4} + {\left (A a^{2} + C b^{2}\right )} c d^{5} + {\left ({\left ({\left (A - C\right )} a^{2} - 2 \, B a b - {\left (A - C\right )} b^{2}\right )} c^{2} d^{4} + 2 \, {\left (B a^{2} + 2 \, {\left (A - C\right )} a b - B b^{2}\right )} c d^{5} - {\left ({\left (A - C\right )} a^{2} - 2 \, B a b - {\left (A - C\right )} b^{2}\right )} d^{6}\right )} f x\right )} \tan \left (f x + e\right )}{2 \, {\left ({\left (c^{4} d^{4} + 2 \, c^{2} d^{6} + d^{8}\right )} f \tan \left (f x + e\right ) + {\left (c^{5} d^{3} + 2 \, c^{3} d^{5} + c d^{7}\right )} f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+b*tan(f*x+e))^2*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(c+d*tan(f*x+e))^2,x, algorithm="fricas")
[Out]
-1/2*(2*C*b^2*c^4*d^2 + 2*A*a^2*d^6 - 2*(2*C*a*b + B*b^2)*c^3*d^3 + 2*(C*a^2 + 2*B*a*b + A*b^2)*c^2*d^4 - 2*(B
*a^2 + 2*A*a*b)*c*d^5 - 2*(((A - C)*a^2 - 2*B*a*b - (A - C)*b^2)*c^3*d^3 + 2*(B*a^2 + 2*(A - C)*a*b - B*b^2)*c
^2*d^4 - ((A - C)*a^2 - 2*B*a*b - (A - C)*b^2)*c*d^5)*f*x - 2*(C*b^2*c^4*d^2 + 2*C*b^2*c^2*d^4 + C*b^2*d^6)*ta
n(f*x + e)^2 + (2*C*b^2*c^6 + 4*C*b^2*c^4*d^2 - (2*C*a*b + B*b^2)*c^5*d + (B*a^2 + 2*(A - 3*C)*a*b - 3*B*b^2)*
c^3*d^3 - 2*((A - C)*a^2 - 2*B*a*b - A*b^2)*c^2*d^4 - (B*a^2 + 2*A*a*b)*c*d^5 + (2*C*b^2*c^5*d + 4*C*b^2*c^3*d
^3 - (2*C*a*b + B*b^2)*c^4*d^2 + (B*a^2 + 2*(A - 3*C)*a*b - 3*B*b^2)*c^2*d^4 - 2*((A - C)*a^2 - 2*B*a*b - A*b^
2)*c*d^5 - (B*a^2 + 2*A*a*b)*d^6)*tan(f*x + e))*log((d^2*tan(f*x + e)^2 + 2*c*d*tan(f*x + e) + c^2)/(tan(f*x +
e)^2 + 1)) - (2*C*b^2*c^6 + 4*C*b^2*c^4*d^2 + 2*C*b^2*c^2*d^4 - (2*C*a*b + B*b^2)*c^5*d - 2*(2*C*a*b + B*b^2)
*c^3*d^3 - (2*C*a*b + B*b^2)*c*d^5 + (2*C*b^2*c^5*d + 4*C*b^2*c^3*d^3 + 2*C*b^2*c*d^5 - (2*C*a*b + B*b^2)*c^4*
d^2 - 2*(2*C*a*b + B*b^2)*c^2*d^4 - (2*C*a*b + B*b^2)*d^6)*tan(f*x + e))*log(1/(tan(f*x + e)^2 + 1)) - 2*(2*C*
b^2*c^5*d - (2*C*a*b + B*b^2)*c^4*d^2 + (C*a^2 + 2*B*a*b + (A + 2*C)*b^2)*c^3*d^3 - (B*a^2 + 2*A*a*b)*c^2*d^4
+ (A*a^2 + C*b^2)*c*d^5 + (((A - C)*a^2 - 2*B*a*b - (A - C)*b^2)*c^2*d^4 + 2*(B*a^2 + 2*(A - C)*a*b - B*b^2)*c
*d^5 - ((A - C)*a^2 - 2*B*a*b - (A - C)*b^2)*d^6)*f*x)*tan(f*x + e))/((c^4*d^4 + 2*c^2*d^6 + d^8)*f*tan(f*x +
e) + (c^5*d^3 + 2*c^3*d^5 + c*d^7)*f)
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 3.74, size = 16225, normalized size = 38.91 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+b*tan(f*x+e))**2*(A+B*tan(f*x+e)+C*tan(f*x+e)**2)/(c+d*tan(f*x+e))**2,x)
[Out]
Piecewise((zoo*x*(a + b*tan(e))**2*(A + B*tan(e) + C*tan(e)**2)/tan(e)**2, Eq(c, 0) & Eq(d, 0) & Eq(f, 0)), (-
A*a**2*f*x*tan(e + f*x)**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 2*I*A*a**2*f*x*ta
n(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + A*a**2*f*x/(4*d**2*f*tan(e + f*x)
**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - A*a**2*tan(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e +
f*x) - 4*d**2*f) + 2*I*A*a**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 2*I*A*a*b*f*x
*tan(e + f*x)**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 4*A*a*b*f*x*tan(e + f*x)/(4
*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 2*I*A*a*b*f*x/(4*d**2*f*tan(e + f*x)**2 - 8*I*
d**2*f*tan(e + f*x) - 4*d**2*f) + 2*I*A*a*b*tan(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) -
4*d**2*f) + A*b**2*f*x*tan(e + f*x)**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 2*I*
A*b**2*f*x*tan(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - A*b**2*f*x/(4*d**2*f
*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 3*A*b**2*tan(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I
*d**2*f*tan(e + f*x) - 4*d**2*f) + 2*I*A*b**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f)
+ I*B*a**2*f*x*tan(e + f*x)**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 2*B*a**2*f*x*
tan(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - I*B*a**2*f*x/(4*d**2*f*tan(e +
f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + I*B*a**2*tan(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*t
an(e + f*x) - 4*d**2*f) + 2*B*a*b*f*x*tan(e + f*x)**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*
d**2*f) - 4*I*B*a*b*f*x*tan(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 2*B*a*b
*f*x/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 6*B*a*b*tan(e + f*x)/(4*d**2*f*tan(e +
f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 4*I*B*a*b/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x)
- 4*d**2*f) + 3*I*B*b**2*f*x*tan(e + f*x)**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) +
6*B*b**2*f*x*tan(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 3*I*B*b**2*f*x/(4
*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 2*B*b**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)
**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 4*I*B*b**2*log(tan(e + f*x)**2 + 1)*tan(
e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 2*B*b**2*log(tan(e + f*x)**2 + 1)/(
4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 5*I*B*b**2*tan(e + f*x)/(4*d**2*f*tan(e + f*x
)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 4*B*b**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*
d**2*f) + C*a**2*f*x*tan(e + f*x)**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 2*I*C*a
**2*f*x*tan(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - C*a**2*f*x/(4*d**2*f*ta
n(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 3*C*a**2*tan(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d*
*2*f*tan(e + f*x) - 4*d**2*f) + 2*I*C*a**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 6
*I*C*a*b*f*x*tan(e + f*x)**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 12*C*a*b*f*x*ta
n(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 6*I*C*a*b*f*x/(4*d**2*f*tan(e + f
*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 4*C*a*b*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(4*d**2*f*tan(
e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 8*I*C*a*b*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(4*d**2*f*
tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 4*C*a*b*log(tan(e + f*x)**2 + 1)/(4*d**2*f*tan(e + f*x
)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 10*I*C*a*b*tan(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*ta
n(e + f*x) - 4*d**2*f) - 8*C*a*b/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 9*C*b**2*f*
x*tan(e + f*x)**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 18*I*C*b**2*f*x*tan(e + f*
x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 9*C*b**2*f*x/(4*d**2*f*tan(e + f*x)**2 -
8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 4*I*C*b**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(4*d**2*f*tan(e + f*
x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 8*C*b**2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)/(4*d**2*f*tan(e +
f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) - 4*I*C*b**2*log(tan(e + f*x)**2 + 1)/(4*d**2*f*tan(e + f*x)**2
- 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) + 4*C*b**2*tan(e + f*x)**3/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e
+ f*x) - 4*d**2*f) + 19*C*b**2*tan(e + f*x)/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f) -
14*I*C*b**2/(4*d**2*f*tan(e + f*x)**2 - 8*I*d**2*f*tan(e + f*x) - 4*d**2*f), Eq(c, -I*d)), (-A*a**2*f*x*tan(e
+ f*x)**2/(4*d**2*f*tan(e + f*x)**2 + 8*I*d**2...
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 912 vs.
\(2 (422) = 844\).
time = 0.94, size = 912, normalized size = 2.19 \begin {gather*} \frac {\frac {2 \, C b^{2} \tan \left (f x + e\right )}{d^{2}} + \frac {2 \, {\left (A a^{2} c^{2} - C a^{2} c^{2} - 2 \, B a b c^{2} - A b^{2} c^{2} + C b^{2} c^{2} + 2 \, B a^{2} c d + 4 \, A a b c d - 4 \, C a b c d - 2 \, B b^{2} c d - A a^{2} d^{2} + C a^{2} d^{2} + 2 \, B a b d^{2} + A b^{2} d^{2} - C b^{2} d^{2}\right )} {\left (f x + e\right )}}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac {{\left (B a^{2} c^{2} + 2 \, A a b c^{2} - 2 \, C a b c^{2} - B b^{2} c^{2} - 2 \, A a^{2} c d + 2 \, C a^{2} c d + 4 \, B a b c d + 2 \, A b^{2} c d - 2 \, C b^{2} c d - B a^{2} d^{2} - 2 \, A a b d^{2} + 2 \, C a b d^{2} + B b^{2} d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} - \frac {2 \, {\left (2 \, C b^{2} c^{5} - 2 \, C a b c^{4} d - B b^{2} c^{4} d + 4 \, C b^{2} c^{3} d^{2} + B a^{2} c^{2} d^{3} + 2 \, A a b c^{2} d^{3} - 6 \, C a b c^{2} d^{3} - 3 \, B b^{2} c^{2} d^{3} - 2 \, A a^{2} c d^{4} + 2 \, C a^{2} c d^{4} + 4 \, B a b c d^{4} + 2 \, A b^{2} c d^{4} - B a^{2} d^{5} - 2 \, A a b d^{5}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{4} d^{3} + 2 \, c^{2} d^{5} + d^{7}} + \frac {2 \, {\left (2 \, C b^{2} c^{5} d \tan \left (f x + e\right ) - 2 \, C a b c^{4} d^{2} \tan \left (f x + e\right ) - B b^{2} c^{4} d^{2} \tan \left (f x + e\right ) + 4 \, C b^{2} c^{3} d^{3} \tan \left (f x + e\right ) + B a^{2} c^{2} d^{4} \tan \left (f x + e\right ) + 2 \, A a b c^{2} d^{4} \tan \left (f x + e\right ) - 6 \, C a b c^{2} d^{4} \tan \left (f x + e\right ) - 3 \, B b^{2} c^{2} d^{4} \tan \left (f x + e\right ) - 2 \, A a^{2} c d^{5} \tan \left (f x + e\right ) + 2 \, C a^{2} c d^{5} \tan \left (f x + e\right ) + 4 \, B a b c d^{5} \tan \left (f x + e\right ) + 2 \, A b^{2} c d^{5} \tan \left (f x + e\right ) - B a^{2} d^{6} \tan \left (f x + e\right ) - 2 \, A a b d^{6} \tan \left (f x + e\right ) + C b^{2} c^{6} - C a^{2} c^{4} d^{2} - 2 \, B a b c^{4} d^{2} - A b^{2} c^{4} d^{2} + 3 \, C b^{2} c^{4} d^{2} + 2 \, B a^{2} c^{3} d^{3} + 4 \, A a b c^{3} d^{3} - 4 \, C a b c^{3} d^{3} - 2 \, B b^{2} c^{3} d^{3} - 3 \, A a^{2} c^{2} d^{4} + C a^{2} c^{2} d^{4} + 2 \, B a b c^{2} d^{4} + A b^{2} c^{2} d^{4} - A a^{2} d^{6}\right )}}{{\left (c^{4} d^{3} + 2 \, c^{2} d^{5} + d^{7}\right )} {\left (d \tan \left (f x + e\right ) + c\right )}}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
integrate((a+b*tan(f*x+e))^2*(A+B*tan(f*x+e)+C*tan(f*x+e)^2)/(c+d*tan(f*x+e))^2,x, algorithm="giac")
[Out]
1/2*(2*C*b^2*tan(f*x + e)/d^2 + 2*(A*a^2*c^2 - C*a^2*c^2 - 2*B*a*b*c^2 - A*b^2*c^2 + C*b^2*c^2 + 2*B*a^2*c*d +
4*A*a*b*c*d - 4*C*a*b*c*d - 2*B*b^2*c*d - A*a^2*d^2 + C*a^2*d^2 + 2*B*a*b*d^2 + A*b^2*d^2 - C*b^2*d^2)*(f*x +
e)/(c^4 + 2*c^2*d^2 + d^4) + (B*a^2*c^2 + 2*A*a*b*c^2 - 2*C*a*b*c^2 - B*b^2*c^2 - 2*A*a^2*c*d + 2*C*a^2*c*d +
4*B*a*b*c*d + 2*A*b^2*c*d - 2*C*b^2*c*d - B*a^2*d^2 - 2*A*a*b*d^2 + 2*C*a*b*d^2 + B*b^2*d^2)*log(tan(f*x + e)
^2 + 1)/(c^4 + 2*c^2*d^2 + d^4) - 2*(2*C*b^2*c^5 - 2*C*a*b*c^4*d - B*b^2*c^4*d + 4*C*b^2*c^3*d^2 + B*a^2*c^2*d
^3 + 2*A*a*b*c^2*d^3 - 6*C*a*b*c^2*d^3 - 3*B*b^2*c^2*d^3 - 2*A*a^2*c*d^4 + 2*C*a^2*c*d^4 + 4*B*a*b*c*d^4 + 2*A
*b^2*c*d^4 - B*a^2*d^5 - 2*A*a*b*d^5)*log(abs(d*tan(f*x + e) + c))/(c^4*d^3 + 2*c^2*d^5 + d^7) + 2*(2*C*b^2*c^
5*d*tan(f*x + e) - 2*C*a*b*c^4*d^2*tan(f*x + e) - B*b^2*c^4*d^2*tan(f*x + e) + 4*C*b^2*c^3*d^3*tan(f*x + e) +
B*a^2*c^2*d^4*tan(f*x + e) + 2*A*a*b*c^2*d^4*tan(f*x + e) - 6*C*a*b*c^2*d^4*tan(f*x + e) - 3*B*b^2*c^2*d^4*tan
(f*x + e) - 2*A*a^2*c*d^5*tan(f*x + e) + 2*C*a^2*c*d^5*tan(f*x + e) + 4*B*a*b*c*d^5*tan(f*x + e) + 2*A*b^2*c*d
^5*tan(f*x + e) - B*a^2*d^6*tan(f*x + e) - 2*A*a*b*d^6*tan(f*x + e) + C*b^2*c^6 - C*a^2*c^4*d^2 - 2*B*a*b*c^4*
d^2 - A*b^2*c^4*d^2 + 3*C*b^2*c^4*d^2 + 2*B*a^2*c^3*d^3 + 4*A*a*b*c^3*d^3 - 4*C*a*b*c^3*d^3 - 2*B*b^2*c^3*d^3
- 3*A*a^2*c^2*d^4 + C*a^2*c^2*d^4 + 2*B*a*b*c^2*d^4 + A*b^2*c^2*d^4 - A*a^2*d^6)/((c^4*d^3 + 2*c^2*d^5 + d^7)*
(d*tan(f*x + e) + c)))/f
________________________________________________________________________________________
Mupad [B]
time = 35.26, size = 2500, normalized size = 6.00 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
int(((a + b*tan(e + f*x))^2*(A + B*tan(e + f*x) + C*tan(e + f*x)^2))/(c + d*tan(e + f*x))^2,x)
[Out]
(log((2*C^2*b^4*c^5 - 2*C^2*a^2*b^2*c^5 + 4*C^2*b^4*c^3*d^2 - A*B*a^4*d^5 - 2*A*C*b^4*c^5 + B*C*a^4*d^5 + 2*A^
2*a*b^3*d^5 - 2*A^2*a^3*b*d^5 - A^2*a^4*c*d^4 + 2*B^2*a^3*b*d^5 - A^2*b^4*c*d^4 + B^2*a^4*c*d^4 + B^2*b^4*c*d^
4 - C^2*a^4*c*d^4 + C^2*b^4*c*d^4 - 4*C^2*a^2*b^2*c^3*d^2 + 5*A*B*a^2*b^2*d^5 + 2*A*C*a^2*b^2*c^5 + A*B*a^4*c^
2*d^3 + 3*A*B*b^4*c^2*d^3 - B*C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